<?php 

	include("config.php");
    include(INCLUDEDIR."core.php");
	include("acceso.php");
	
	$tpl = new Plantilla();
	$tpl->setPlantilla("tpl.nuevas.html");
	$tpl->prepare();
	
	$query = "SELECT * FROM categorias";
	
	$r = mysql_query($query);
	
	if($r && mysql_num_rows($r)>0) {
		$tpl->newBlock("CATEGORIAP");
		while($fila = mysql_fetch_assoc($r)) {
			// Array ( [id_categoria] => 24 [id_categoria_padre] => 0 [nombre_categoria] => Materias Bachillerato [icon] => ) 
			$tpl->newBlock("FILA");
			$fila['nombre_categoria'] = strtoupper($fila['nombre_categoria']);
			foreach($fila as $key => $value) $tpl->assign($key,$value);

			
		}
	}
	

	$tpl->Mostrar();
?>